package study01;

public class Java21_niMingClass {
    public static void main(String[] args) {
        Me me = new Me();
//        匿名类     这个就是给抽象类的方法重写的例子
        me.sayHi(new Person21() {
            @Override
            public String name() {
                return "zs";
            }
        });
    }
}

abstract class Person21 {
    public abstract String name();
}

class Me {
    public void sayHi(Person21 person21) {
        System.out.println("Hi" + person21.name());
    }
}
